﻿using Nature.Core.DDD.UnitOfWork;
using StructureMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nature.Core.DDD.DomainEvent
{
    public class DomainEventContext<T> 
        where T:IDomainEvent
    {
        public DomainEventContext(T theEvent)
        {
            QueryFac = ObjectFactory.GetInstance<IQueryFactory>();
            Repository = ObjectFactory.GetInstance<IRepository>();
            UnitOfWork = ObjectFactory.GetInstance<IUnitOfWork>();
            Event = theEvent;
        }
        //仓储
        public readonly IRepository Repository;
        //UnitOfWork
        public readonly IUnitOfWork UnitOfWork;
        public readonly IQueryFactory QueryFac;

        public readonly T Event;
    }
}
